package lab02.test23;

import com.sun.xml.internal.ws.api.server.SDDocumentFilter;

import java.nio.channels.CancelledKeyException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;
import java.util.SimpleTimeZone;

/**
 * Created by MECHREV on 2017/11/2.
 */
public class Test1 {
    public static void main(String[] args) throws ParseException {
//键盘输入生日
        Scanner scanner = new Scanner(System.in);
        String birthday;
        birthday = scanner.nextLine();
        //生日还有几天
        //一秒=一千毫秒
        SimpleDateFormat simpleDateFormat= new SimpleDateFormat("yyyy-mm-dd");
        Calendar calendar = Calendar.getInstance();
        Long time1;
        Long time2;
        calendar.setTime(simpleDateFormat.parse(birthday));
        time1 = calendar.getTimeInMillis();
        calendar.setTime(simpleDateFormat.parse("2017-11-02"));
        time2 = calendar.getTimeInMillis();
        System.out.println("相差的天数是："+(time1-time2)/(24*60*60*1000));
    }
}
